package com.smartcat.web;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.Logger;

public class WebInitListener implements ServletContextListener{

	static final Logger logger=Logger.getLogger(WebInitListener.class);
	@Override
	public void contextDestroyed(ServletContextEvent arg0) {
		logger.info("system exist!");
		
	}

	@Override
	public void contextInitialized(ServletContextEvent event) {
		String rootDir=event.getServletContext().getContextPath();
		event.getServletContext().setAttribute("rootDir", rootDir);
		VelocityHelper vhelper=new VelocityHelper();
		event.getServletContext().setAttribute("VelocityHelper", vhelper);
		
	}

}
